package com.yunhe.spring.util;

import com.alibaba.druid.pool.DruidDataSourceFactory;

import javax.sql.DataSource;
import java.util.Properties;


public class DruidFactory {
    public static DataSource createFactory(){
        DataSource dataSource = null;
        Properties druidConfig = new PropertiesHandler("druid").getProperties();
        try {
            dataSource = DruidDataSourceFactory.createDataSource(druidConfig);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return dataSource;
    }
}
